<template>
	<view class="page flex-col">
		<view class="block_1 flex-col">
			<view class="box_2 flex-row">
				<text class="text_2">全部(4)</text>
				<text class="text_3">状态</text>
				<view class="group_1 flex-col"></view>
			</view>
			<view class="box_3 flex-row">
				<div class="section_1 flex-col"></div>
			</view>
		</view>
		<view class="block_2 flex-col">
			<view class="box_7 flex-col"></view>
		</view>
		<view class="block_3 flex-col">
			<view class="list_1 flex-col">
				<view class="list-items_1 flex-col" v-for="(item, index) in recordList" :key="index"
					@tap="Rdetail(item)">
					<view class="group_2 flex-row">
						<view class="text-wrapper_1 flex-col" :style="item.textColor">
							<text class="text_4" v-html="item.stateL"></text>
						</view>
						<view class="box_8 flex-col justify-between">
							<view class="group_3 flex-row">
								<image class="thumbnail_3" referrerpolicy="no-referrer" :src="item.nameImg" />
								<text class="text_5" v-html="item.real_name"></text>
								<image class="thumbnail_4" referrerpolicy="no-referrer" :src="item.positionImg" />
								<text class="text_6" v-html="item.name"></text>
							</view>
							<text class="text_7" v-html="item.create_time"></text>
						</view>
						<text class="text_8" :style="{ color: item.bgColor }" v-html="item.stateR"
							@tap="statusK(item)"></text>
					</view>
					<text class="text_9" v-html="item.refuse_desc"></text>
				</view>
			</view>
			<view class="section_5 flex-col">
				<view class="group_4 flex-col"></view>
				<view class="group_5 flex-col"></view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				recordList: [{
						lanhuBg2: 'linear-gradient(141deg, rgba(255,208,161,1.000000) 0, rgba(255,127,0,1.000000) 100.000000%)',
						lanhutext0: '审核中',
						lanhuimage0: 'https://lanhu.oss-cn-beijing.aliyuncs.com/MasterDDSSlicePNGfe76cd22e059aadc42b6476a8887a3c9.png',
						lanhutext1: '刘富贵',
						lanhuimage1: 'https://lanhu.oss-cn-beijing.aliyuncs.com/MasterDDSSlicePNG34b86d365ef718d0ecdef3611583325e.png',
						lanhutext2: '工匠——油漆工',
						lanhutext3: '2023/10/10&nbsp;&nbsp;15:30:32',
						lanhutext4: '撤回申请',
						lanhufontColor4: 'rgba(255,127,0,1.000000)',
						lanhutext5: '您好，您的申请已提交，我们会尽快审核，请耐心等待。感谢您的理解与配合！',
					},
					{
						lanhuBg2: 'linear-gradient(141deg, rgba(255,161,161,1.000000) 0, rgba(255,0,0,1.000000) 100.000000%)',
						lanhutext0: '未通过',
						lanhuimage0: 'https://lanhu.oss-cn-beijing.aliyuncs.com/MasterDDSSlicePNGfe76cd22e059aadc42b6476a8887a3c9.png',
						lanhutext1: '刘富贵',
						lanhuimage1: 'https://lanhu.oss-cn-beijing.aliyuncs.com/MasterDDSSlicePNG34b86d365ef718d0ecdef3611583325e.png',
						lanhutext2: '工匠——油漆工',
						lanhutext3: '2023/10/10&nbsp;&nbsp;15:30:32',
						lanhutext4: '重新上传',
						lanhufontColor4: 'rgba(255,25,25,1.000000)',
						lanhutext5: '您好，因您上传的头像照片不符合平台要求导致审核失败，请重新上传！',
					},
					{
						lanhuBg2: 'linear-gradient(141deg, rgba(124,253,137,1.000000) 0, rgba(0,185,19,1.000000) 100.000000%)',
						lanhutext0: '已通过',
						lanhuimage0: 'https://lanhu.oss-cn-beijing.aliyuncs.com/MasterDDSSlicePNGfe76cd22e059aadc42b6476a8887a3c9.png',
						lanhutext1: '刘富贵',
						lanhuimage1: 'https://lanhu.oss-cn-beijing.aliyuncs.com/MasterDDSSlicePNG34b86d365ef718d0ecdef3611583325e.png',
						lanhutext2: '工匠——油漆工',
						lanhutext3: '2023/10/10&nbsp;&nbsp;15:30:32',
						lanhutext4: '去接单',
						lanhufontColor4: 'rgba(0,181,18,1.000000)',
						lanhutext5: '您好，恭喜您已成功入驻䒵饰平台，快去订单广场接单吧！',
					},
				],

			};
		},
		onLoad() {
			this.Getrecord()
		},
		methods: {
			Getrecord() {
				this.$api.get({
					url: '/jmy/user_worker/workerLogs',
					data: {},
					success: res => {
						this.recordList = res.map((item, index) => {
							item.nameImg =
								'https://lanhu.oss-cn-beijing.aliyuncs.com/MasterDDSSlicePNGfe76cd22e059aadc42b6476a8887a3c9.png'
							item.positionImg =
								'https://lanhu.oss-cn-beijing.aliyuncs.com/MasterDDSSlicePNG34b86d365ef718d0ecdef3611583325e.png'
							if (item.status == 0) { //撤销申请/
								item.stateL = '已撤回'
								item.stateR = '已撤回'
								item.bgColor = '#666666'
								item.textColor =
									'background: linear-gradient(140deg, #B5B5B5 19%, #727272 80%);'
							} else if (item.status == 1) {
								item.stateL = '审核中' //申请中
								item.stateR = '撤回申请'
								item.bgColor = '#FF7F00'
								item.textColor =
									'background: linear-gradient(140deg, #FFD0A1 19%, #FF7F00 80%);'
							} else if (item.status == -1) { //已拒绝
								item.stateL = '未通过'
								item.stateR = '重新上传'
								item.bgColor = '#FF0000'
								item.textColor =
									'background: linear-gradient(140deg, #FFA1A1 19%, #FF0000 80%);'
							} else {
								item.stateL = '已通过' //yitongguo
								item.stateR = '去接单'
								item.bgColor = '#00B913'
								item.textColor =
									'background: linear-gradient(140deg, #7CFD89 19%, #00B913 80%);'
							}
							return item
						})
						console.log(this.recordList, '---')
					}
				})
			},
			Rdetail(item) {
				uni.navigateTo({
					url: '/pages/user/Rdetails/Rdetails?item' + JSON.stringify(decodeURIComponent(item))
				})
			},
			statusK(item) {
				if (item.status == -1) {
					this.$wanlshop.to(`/pages/artison/worker_register/worker_register?id=${item.worker_id}`)
				} else if (item.status == 2) {
					uni.reLaunch({
						url: "/pages/tabbarcompotant/index/landlord"
					})
				} else if (item.status == 1) {
					uni.showModal({
						title: '您好',
						content: '确定要撤回申请吗？',
						cancelText: '取消',
						confirmText: '确认',
						success: res => {
						this.withdraw(item)
						}
					})
				}
			},
			withdraw(item) { //重新刷新列表
				this.$api.get({
					url: "/jmy/user_worker/cancel",
					data: {
						worker_id:item.worker_id
					},
					success: res => {
						this.Getrecord()
						this.$wanlshop.msg('撤销成功')
						console.log(res, '--->')
					}
				})
			}
		},
	};
</script>
<style>
	.page {
		background-color: rgba(245, 245, 245, 1);
		position: relative;
		width: 100vw;
		height: 216.42vw;
		overflow: hidden;
	}

	.block_1 {
		background-color: rgba(255, 255, 255, 1);
		height: 16.18vw;
		width: 100vw;
		position: relative;
	}

	.box_1 {
		width: 53.85vw;
		height: 6.42vw;
		margin: 14.61vw 0 0 2.82vw;
	}

	.label_1 {
		width: 6.67vw;
		height: 6.16vw;
	}

	.text_1 {
		width: 17.44vw;
		height: 6.42vw;
		overflow-wrap: break-word;
		color: rgba(18, 18, 18, 1);
		font-size: 4.35vw;
		font-family: Source Han Sans-Medium;
		font-weight: 500;
		text-align: left;
		white-space: nowrap;
		line-height: 6.42vw;
	}

	.box_2 {
		width: 50vw;
		height: 6.67vw;
		margin: 3.38vw 0 0 25.12vw;
	}

	.text_2 {
		width: 12.83vw;
		height: 5.65vw;
		overflow-wrap: break-word;
		color: rgba(255, 69, 48, 1);
		font-size: 3.84vw;
		font-family: Source Han Sans-Medium;
		font-weight: 500;
		text-align: left;
		white-space: nowrap;
		line-height: 5.65vw;
	}

	.text_3 {
		width: 7.7vw;
		height: 5.65vw;
		overflow-wrap: break-word;
		color: rgba(102, 102, 102, 1);
		font-size: 3.84vw;
		font-family: Source Han Sans-Medium;
		font-weight: 500;
		text-align: left;
		white-space: nowrap;
		line-height: 5.65vw;
		margin-left: 25.39vw;
	}

	.group_1 {
		width: 3.11vw;
		height: 2.57vw;
		background-image: url('https://img.aibbyp.com/wechat/newImg/my/border.png');
		margin-top: 2vw;
		background-size: 100%;
		margin-left: 4px;
		background-repeat: no-repeat;
	}

	.box_3 {
		width: 7.7vw;
		height: 0.26vw;
		margin: 1.02vw 0 2.82vw 27.69vw;
	}

	.section_1 {
		width: 7.7vw;
		height: 0.26vw;
		border: 2px solid rgba(255, 70, 48, 1);
	}

	.box_4 {
		position: absolute;
		left: 0;
		top: -0.25vw;
		width: 100vw;
		height: 12.31vw;
	}

	.image_1 {
		width: 8.47vw;
		height: 3.85vw;
		margin: 3.84vw 0 0 8.2vw;
	}

	.thumbnail_1 {
		width: 5.13vw;
		height: 3.59vw;
		margin: 4.1vw 0 0 62.05vw;
	}

	.thumbnail_2 {
		width: 4.11vw;
		height: 3.59vw;
		margin: 4.1vw 0 0 1.02vw;
	}

	.box_5 {
		height: 3.08vw;
		background: url(https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/66891787d72a466bab7b6e1b64e44e0b_mergeImage.png) 100% no-repeat;
		background-size: 100% 100%;
		width: 6.42vw;
		margin: 4.35vw 3.58vw 0 1.02vw;
	}

	.section_2 {
		background-color: rgba(0, 0, 0, 1);
		border-radius: 1px;
		width: 4.88vw;
		height: 2.06vw;
		margin: 0.51vw 0 0 0.51vw;
	}

	.box_6 {
		position: absolute;
		left: 0;
		top: 12.06vw;
		width: 100vw;
		height: 11.29vw;
	}

	.block_2 {
		position: absolute;
		left: 0;
		top: 0;
		width: 100vw;
		height: 0.52vw;
	}

	.box_7 {
		width: 4.11vw;
		height: 216.42vw;
	}

	.block_3 {
		position: absolute;
		left: 0;
		top: 14.44vw;
		width: 100vw;
		height: 179.24vw;
	}

	.list_1 {
		width: 91.8vw;
		height: 110.77vw;
		justify-content: space-between;
		margin: 5.12vw 0 0 4.1vw;
	}

	.list-items_1 {
		background-color: rgba(255, 255, 255, 1);
		border-radius: 9px;
		width: 91.8vw;
		height: 34.88vw;
		margin-bottom: 3.08vw;
		justify-content: flex-center;
	}

	.group_2 {
		width: 85.65vw;
		height: 12.57vw;
		margin: 3.07vw 0 0 3.07vw;
	}

	.text-wrapper_1 {
		background: linear-gradient(140deg, #FFD0A1 19%, #FF7F00 80%);
		border-radius: 50%;
		height: 12.31vw;
		width: 12.31vw;
	}

	.text_4 {
		width: 9.24vw;
		height: 4.36vw;
		overflow-wrap: break-word;
		color: rgba(255, 255, 255, 1);
		font-size: 3.07vw;
		font-family: Source Han Sans-Bold;
		font-weight: 700;
		text-align: left;
		white-space: nowrap;
		line-height: 4.36vw;
		margin: 4.1vw 0 0 1.53vw;
	}

	.box_8 {
		width: 51.03vw;
		height: 11.8vw;
		margin: 0.25vw 0 0 4.1vw;
	}

	.group_3 {
		width: 51.03vw;
		height: 5.39vw;
	}

	.thumbnail_3 {
		width: 4.36vw;
		height: 4.36vw;
		margin-top: 0.77vw;
	}

	.text_5 {
		width: 11.54vw;
		height: 5.39vw;
		overflow-wrap: break-word;
		color: rgba(128, 128, 128, 1);
		font-size: 3.58vw;
		font-family: Source Han Sans-Regular;
		font-weight: normal;
		text-align: left;
		white-space: nowrap;
		line-height: 5.39vw;
		margin-left: 0.52vw;
	}

	.thumbnail_4 {
		width: 4.36vw;
		height: 4.36vw;
		margin: 0.76vw 0 0 4.1vw;
	}

	.text_6 {
		width: 25.65vw;
		height: 5.39vw;
		overflow-wrap: break-word;
		color: rgba(128, 128, 128, 1);
		font-size: 3.58vw;
		font-family: Source Han Sans-Regular;
		font-weight: normal;
		text-align: left;
		white-space: nowrap;
		line-height: 5.39vw;
		margin-left: 0.52vw;
	}

	.text_7 {
		width: 29.49vw;
		height: 4.36vw;
		overflow-wrap: break-word;
		color: rgba(153, 153, 153, 1);
		font-size: 3.07vw;
		font-family: Source Han Sans-Regular;
		font-weight: normal;
		text-align: left;
		white-space: nowrap;
		line-height: 4.36vw;
		margin-top: 3.06vw;
	}

	.text_8 {
		width: 14.36vw;
		height: 5.13vw;
		overflow-wrap: break-word;
		font-size: 3.58vw;
		font-family: Source Han Sans-Medium;
		font-weight: 500;
		text-align: left;
		white-space: nowrap;
		line-height: 5.13vw;
		margin: 7.43vw 0 0 3.84vw;
	}

	.text_9 {
		width: 85.65vw;
		height: 10.26vw;
		overflow-wrap: break-word;
		color: rgba(61, 61, 61, 1);
		font-size: 3.58vw;
		font-family: Source Han Sans-Medium;
		font-weight: 550;
		text-align: left;
		line-height: 5.13vw;
		margin: 5.89vw 0 3.07vw 3.07vw;
	}

	.section_3 {
		width: 100vw;
		height: 12.57vw;
		margin-top: 41.8vw;
	}

	.section_4 {
		height: 8.72vw;
		margin-bottom: 0.26vw;
		width: 100vw;
	}

	.box_9 {
		background-color: rgba(0, 0, 0, 1);
		border-radius: 25px;
		width: 35.9vw;
		height: 1.29vw;
		margin: 5.38vw 0 0 32.05vw;
	}

	.section_5 {
		position: absolute;
		left: 95.9vw;
		top: -37.17vw;
		width: 4.11vw;
		height: 216.42vw;
	}

	.group_4 {
		width: 2.57vw;
		height: 2.57vw;
		margin: 45.64vw 0 0 0.25vw;
	}

	.group_5 {
		width: 2.57vw;
		height: 2.57vw;
		margin: 13.33vw 0 152.3vw 0.25vw;
	}

	body *,
	page view {
		box-sizing: border-box;
		flex-shrink: 0;
	}

	body {
		font-family: PingFangSC-Regular, Roboto, Helvetica Neue, Helvetica, Tahoma,
			Arial, PingFang SC-Light, Microsoft YaHei;
		margin: 0;
	}

	button {
		margin: 0;
		padding: 0;
		border: 1px solid transparent;
		outline: none;
		background-color: transparent;
	}

	button:active {
		opacity: 0.6;
	}

	.flex-col {
		display: flex;
		flex-direction: column;
	}

	.flex-row {
		display: flex;
		flex-direction: row;
	}

	.justify-start {
		display: flex;
		justify-content: flex-start;
	}

	.justify-center {
		display: flex;
		justify-content: center;
	}

	.justify-end {
		display: flex;
		justify-content: flex-end;
	}

	.justify-evenly {
		display: flex;
		justify-content: space-evenly;
	}

	.justify-around {
		display: flex;
		justify-content: space-around;
	}

	.justify-between {
		display: flex;
		justify-content: space-between;
	}

	.align-start {
		display: flex;
		align-items: flex-start;
	}

	.align-center {
		display: flex;
		align-items: center;
	}

	.align-end {
		display: flex;
		align-items: flex-end;
	}
</style>